<!-- <style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style> -->
<template src="./index.html"></template>
<script>
    export default {
        mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
        components: {
            SelectImage: async () => Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectImage())
        },
        data() {
            return {
                appWindow: window,
                form: {
                    // 业绩奖励
                    achievements: [],
                    // 奖励层级
                    award_number: 2,
                    // 分红比例
                    deduct_ratio: "3.00",
                    // deleted_at: null,
                    // 育人奖比例
                    educate_ratio: "30.00",
                    // 平级奖比例
                    equal_ratio: "30.00",
                    // 感恩奖比例
                    grade_ratio: "30.00",
                    id: 4,
                    // 
                    level_weight: 1,
                    // 等级名称
                    name: "V11",
                    // 超越奖比例
                    transcend_ratio: "30.00",

                    created_at: "",
                    updated_at: "",

                },
                
                // 页面接口地址
                apiUrl: {
                    create: "plugin/dealer-bonus/admin/level/addLevel",
                    update: "plugin/dealer-bonus/admin/level/editLevel",
                    detail: "plugin/distribution/backend/distributor/check?pageNum=1&pageSize=20",
                },
                loading: true,
            };
        },
        methods: {
            // form 提交添加/修改 的参数扩展方法
            mixinEdit_editFormSubmitExtend(data_) { 
                
                return data_;
            },
            // 编辑修改的参数扩展方法
            mixinEdit_editDataExtend(data_) {
                // 添加
                if (this.mixinEdit_editType == "add") {
                    
                }
                // 修改
                else if (this.mixinEdit_editType == "update") {

                }
                // 复制
                else if (this.mixinEdit_editType == "copy") {
                    
                }

                return data_;
            },
            

            // 初始化
            async init() {
                this.form.amount = this.amount
                // 初始化数据
                await this.mixinEdit_editBoxInit({
                    model: "form",
                    id: this.id,
                    member_id: this.member_id,
                });
            },


        },
        mounted() {
            this.init();
        },
        activated() {},
    };
</script>